<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
    <title>商品列表页</title>
    <link rel="stylesheet" href="../css/commodity.css">
</head>

<body>
    <div id="app">
        <h2>商品列表</h2>
        <ul>
            <li v-for="(object, index) in objects">
                <a v-bind:href="object.url">
                    <img v-bind:src="object.img">
                    <!-- 下标:{{index + 1}}  -->
                    <br>
                    <span id="price">{{object.price}}</span>
                    <br>
                    <span id="title">{{object.title}}</span>
                </a>
            </li>
        </ul>
    </div>
</body>
<script>
    let app = new Vue({
        el: "#app",
        data: {
            objects: [
                {
                    img: "https://img12.360buyimg.com/seckillcms/s280x280_jfs/t1/180643/5/22058/104008/62454b78E119d150c/199912d8cdb00212.jpg.webp",
                    url: "https://item.jd.com/100009038173.html",
                    price: "￥1698.00",
                    title: "Jeep吉普黑骑士智能手表",//男电话手表运动4G通话上网微信电子表成人中学生手表男64G
                },
                {
                    img: "https://img30.360buyimg.com/seckillcms/s280x280_jfs/t1/220366/20/3753/61112/618a46e0E4a14bb1a/ceb318079af6ca77.jpg.webp",
                    url: "https://item.jd.com/100014438267.html",
                    price: "￥3668.00",
                    title: "HUAWEI nova9 Pro 4G全网通",// 双3200万前置Vlog镜头 100W超级快充 10亿色臻彩屏 8+256GB 亮黑色华为手机
                },
                {
                    img: "https://img10.360buyimg.com/seckillcms/s280x280_jfs/t1/123372/39/27676/150503/6246cf7aEf8961733/7d78a396a084aace.jpg.webp",
                    url: "https://item.jd.com/10028550950150.html",
                    price: "￥1399.00",
                    title: "网易严选 3D悬挂腰靠人体工学椅",// 坐躺两用撑腰护颈高弹网面可调节滑动电脑椅办公椅电竞椅 D1-太空灰 人体工学转椅
                },
                {
                    img: "https://img30.360buyimg.com/seckillcms/s280x280_jfs/t1/134989/34/26758/133443/6248317eEab0553b1/9c89f9a44f567f82.jpg.webp",
                    url: "https://item.jd.com/44079956337.html",
                    price: "￥299.00",
                    title: "京东京造茅台镇酱酒单瓶",//京东京造 正道行者53度 500ml礼盒装 茅台镇珍藏 酱香型白酒 （典藏款）
                }
            ],

        },
        methods: {
            // click: function () {
                // return this.url;
                // return this.index;
            // }
        }
    })
</script>

</html>